<?php
if ($_GET["type"] && $_GET["type"] == "fr")
    $rs = $member->getFriendByName($_GET["q"]);
else
    $arr = $member->getByName($_GET["q"], 8);

# JSON-encode the response
$json_response = json_encode($arr);

# Optionally: Wrap the response in a callback function for JSONP cross-domain support
if ($_GET["callback"]) {
    $json_response = $_GET["callback"] . "(" . $json_response . ")";
}

# Return the response

if ($_GET["type"] && $_GET["type"] == "fr") {
    echo $json_response;
} else {
    foreach ($arr as $key => $value) {
        ?>
        <a href="/thanh-vien?mid=<?php echo $value['id']; ?>">
            <div class="display_box" align="left">

                <img src="<?php echo $common->get_avatar_thumb($value['avatar']); ?>" /><?php echo $value['fullname']; ?><br/>
                <span class="sub_text" ><?php echo $value['email']; ?></span>

            </div></a>
        <?php
    }
}
die;
?>